<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Payroll Wizard</title>
<script type="text/javascript" src="/js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="/js/jquery-ui-1.8.21.custom.min.js"></script>
<script type="text/javascript" src="/js/jquery.leanModal.min.js"></script>
<link type="text/css" href="/css/start/jquery-ui-1.8.21.custom.css" rel="Stylesheet" />	
<script language="javascript"> 
function transfer(date_begin,date_end){
	window.location.href = 'http://<?php echo WEB_IP?>/rosteraudit/payroll-wizard-calculate-leave/date_begin/'+ date_begin + '/date_end/' + date_end + '/next/yes';
}
function myFunction() {
    window.print();
}

</script>
</head>

<body style="font-family:Arial, Helvetica, sans-serif">
<?php 
$stDetail = new Model_DbTable_Roster_Stafflogindetail();
$stInfo = new Model_DbTable_Roster_Staffinfo();
$allowanceType = unserialize(ALLOWANCE_TYPE);?>
<h1>Payroll Wizard Calculate Allowance</h1>
<h3>Payroll ( <?php echo $this->dateBegin;?> ~ <?php echo $this->dateEnd;?> )</h3>
<form action = "" method = "post">
	<h3>Allowance List (Total <?php echo count($this->allowanceList);?>)</h3>
	<table border="1" cellspacing="0" cellpadding="2" style="font-size:10px;">
		<tr>
			<td style="width:65px;">ID Bonus</td>
   			<td style="width:120px;">Staff</td>
    		<td style="width:150px;">Allowance Type</td>
    		<td style="width:100px;">Amount</td>
    		<td style="width:100px;">Will Pay On</td>
		</tr>
		<?php foreach($this->allowanceList as $k => $v){
		    	$sdRow = $stDetail->getDetail($v['staff_id']);
		    	$stRow = $stInfo->getStaffinfo($v['staff_id']);
		    	$nName = $sdRow['ni'];
		    	$fName = Model_EncryptHelper::getSslPassword($sdRow['n']);
		    	?>
			<tr>
				<td><?php echo $v['id'];?></td>
				<td><?php echo ucwords($nName." <br />[ ".$fName." ]");?></td>
				<td><?php echo $allowanceType[$v['allowance_type']][1];?></td>
				<td><?php echo $v['allowance_amount']?></td>
				<td width="20"><?php echo $v['allowance_pay_date']?></td>
			</tr>
			<?php 
		    }?>
	</table>

	<br/>
	<br/>
	<input type = "submit" id = "export_file" name = "export_file" value = "Export File"></input> 


</form>

	<br/>
	<?php if($this->link){
		echo "Total ".$this->cashCount."Cash Staff has been generated"."<br/>";
		echo "Total ".$this->bankCount."Bank Staff has been generated"."<br/>";
		echo $this->link."<br/>";?>
	
	<?php }?>

<input type = "submit" id = "next" name = "next" value = "Next" style = "margin-left:700px;" onclick= "transfer('<?php echo $this->dateBegin;?>','<?php echo $this->dateEnd;?>')"></input>


</body>
</html>

